
import math
import numpy as np


dag = 0.0
rad = math.pi * (dag / 180.0)
cx, cy, w, h, theta = 100, 100, 100.0, 40.0, rad

C = np.array([
    [cx, cy],
])

R = np.array([
    [ math.cos(theta), math.sin(theta)],
    [-math.sin(theta), math.cos(theta)],
])

pts = np.array([
    [-w/2, -h/2],
    [ w/2, -h/2],
    [ w/2,  h/2],
    [-w/2,  h/2],
])

rot_pts = []
for pt in pts:
    rot_pts.append((C + pt @ R))

print(rot_pts)
